requireJS(['constant', 'site', 'handlebars'], function (constant, site, Handlebars) {
    //查询微信接口
    function init() {

        site.send({
            url: "manager/selectWeixinSet.do",
            //async:false
            callback: function (data) {
                data = JSON.parse(data);
                if (data.type == '1') {
                    $("#id").val(data.content.id);
                    $("#appId").val(data.content.appId);
                    $("#appSecret").val(data.content.appSecret)
                } else {
                    constant.fn.Message('F', data.msg);
                }
            }
        })

    }

    init();
    //修改微信接口
    var weixinMsg = {};

    $("#weixin_submit").click(function () {
        constant.fn.formParam("#weixin_change", weixinMsg);
        site.send({
            url: "manager/updateWeixinSet.do",
            data: weixinMsg,
            //async:false,
            callback: function (data) {
                var list = JSON.parse(data);
                if (list.type == '1') {
                    init();
                    constant.fn.Message('T',list.msg);
                } else {
                    constant.fn.Message('F',list.msg);
                }

            }
        })
    })
})
